<template>
  <div class="benner-box">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" height="200">
      <van-swipe-item v-for="image in images" :key="image">
        <img id="benner-img" :src="image" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
export default {
  props: {
    // 图片数组
    imgList: {
      type: Array
    },
    // 切换时间
    time: {
      type: String
    }
  },
  setup() {
    const images = [
      'https://img.yzcdn.cn/vant/apple-1.jpg',
      'https://img.yzcdn.cn/vant/apple-2.jpg',
      'https://img.yzcdn.cn/vant/apple-1.jpg',
      'https://img.yzcdn.cn/vant/apple-2.jpg',
      'https://img.yzcdn.cn/vant/apple-1.jpg',
      'https://img.yzcdn.cn/vant/apple-2.jpg',
      'https://img.yzcdn.cn/vant/apple-1.jpg',
      'https://img.yzcdn.cn/vant/apple-2.jpg',
      'https://img.yzcdn.cn/vant/apple-1.jpg',
      'https://img.yzcdn.cn/vant/apple-2.jpg'
    ]
    return {
      images
    }
  }
}
</script>

<style lang="scss" scoped>
.benner-box {
  margin: 10px 15px 10px 10px;
  border-radius: 5%;
  overflow: hidden;
  #benner-img {
    width: 100vw;
    height: 100%;
  }
}
</style>
